home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / adikit.arc / IBMA.ASM < prev    next >
Encoding:
Assembly Source File  |  1986-12-01  |  2.1 KB  |  71 lines

  1. ;               IBMA.ASM
  2.         name    IBMA
  3. include dos.mac
  4. ;       Assembler-language machine-dependent code for the IBM PC
  5. ;       version of AutoCAD.
  6.  
  7.  
  8.  
  9.         dseg    ibma            ; ** start data segment **
  10. dbent   equ     this dword
  11.         dw      dgroup:doint
  12.         dw      0               ;ds plugged here.
  13. doint   proc    far
  14.         int     0               ;int plugged here.
  15.         ret
  16. doint   endp
  17.  
  18.         endds   ibma            ; ** end data segment **
  19.  
  20.  
  21.         pseg    ibma_           ; ** start code segment **
  22.  
  23.         public  aconin,ibmbios
  24.  
  25. ;       char=aconin():          If a keyboard input character is
  26. ;                               available, return it, else 0.  Set bit
  27. ;                               80h for extended codes.
  28.  
  29.  
  30. aconin  proc    far
  31.         mov     dl,0FFH         ;Ask
  32.         mov     ah,6            ;    for a
  33.         int     21H             ;    character from the console.
  34.         jz      nochar          ;Zero flag means none available.
  35.         or      al,al           ;If al=0, extended code,
  36.         jnz     gotchar         ;    call OS for
  37.         int     21H             ;    second part.
  38.         or      al,80h          ;Set high bit to flag it special.
  39.         jmp     short gotchar
  40. nochar:
  41.         xor     al,al           ;No character.
  42. gotchar:
  43.         xor     ah,ah
  44.         ret
  45. aconin  endp
  46.  
  47.  
  48. ;       ibmbios(int, ah, al, dx, cx, bx):
  49.  
  50. ;       will put the arguments in the named registers and take the
  51. ;       specified interrupt.  Returns whatever lands in ax (and dx).
  52.  
  53. ibmbios proc    far
  54.         push    bp
  55.         mov     bp,sp
  56.         mov     ah,args                 ;Plug the
  57.         mov     byte ptr doint+1,ah      ;   interrupt number.
  58.         mov     ah,args+2
  59.         mov     al,args+4
  60.         mov     dx,args+6
  61.         mov     cx,args+8
  62.         mov     bx,args+10
  63.         mov     word ptr dbent+2,ds     ;Store ds for far call
  64.         call    dbent           ;   into d-bank.
  65.         pop     bp
  66.         ret
  67. ibmbios endp
  68.  
  69.         endps   ibma_
  70.         end
  71.